<template>
  <div id="boxlist" class="flex" style="flex:1; ">
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='search' v-ref:cri>
        <div novalidate class="form-inline" partial>
        </div>
      </criteria>
      <data-grid :model="model" partial='list' v-ref:grid>
        <template partial='head'>
          <tr>
            <th>序号</th>
            <th>用户编号</th>
            <th>用户名称</th>
            <th>用户地址</th>
            <th>片区/管理站</th>
          </tr>
        </template>
        <template partial='body'>
          <td style="text-align: center;">{{$index+1}}</td>
          <td>{{row.f_userinfo_id}}</td>
          <td>{{row.f_user_name}}</td>
          <td>{{row.f_address}}</td>
          <td>{{row.f_slice_area}}</td>
        </template>
      </data-grid>
  </criteria-paged>
 </div>
</template>
<script>
import { PagedList } from 'vue-client'
// import AppData from '../../../../stores/AppData'

export default {
  title: '调压箱',
  data () {
    return {
      model: new PagedList('rs/sql/singleTable_OrderBy', 20, {items: '`*`', tablename: '`t_userinfo`', orderitem: '`f_userinfo_id DESC`'})
    }
  },
  props: ['data'],
  ready () {
    this.model.search(`f_adjustable_id = ${this.data.id}`)
  },
  methods: {
    search () {
      this.$dispatch('search')
    }
  },
  watch: {
    data () {
      this.model.search(`f_adjustable_id = ${this.data.id}`)
    }
  }
}
</script>
